<?php
/**
 * @Author: Marte
 * @Date:   2017-08-13 19:55:58
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-08-13 20:40:03
 */



// 增加自我简介和隐私设置
//
//
//
//
session_start();
if(!isset($_POST["submit"])){
      exit('非法访问!');
  }

$_setprivacy=$_POST['yinsi'];//获取隐私选项，所有人可见为1，部分人可见为0
$_introduce=$_POST['intro'];
header('Content-Type:text/html;charset=utf-8');
include "../config_connect.php";//导入数据库
$username=$_SESSION['username'];//取得session

 $_sql1='update userregisters set setprivacy="'.$_setprivacy.'"   where username="'.$username.'"';
 $_sql2='update userregisters set introduce="'.$_introduce.'"   where username="'.$username.'"';
if($_mysql->query($_sql1)&&$_mysql->query($_sql2))
{
    echo "<script>location='../../person.php?change=3&change=3';</script>";
}else{
    echo "fail";
}

?>